/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * plantilla.java
 *
 * Created on 31/10/2011, 12:00:51 AM
 */
package vista.panel.altas;

import controlador.EventoBoton;
import controlador.Listar;
import modelo.Referencia;

/**
 *
 * @author Elias Mendoza
 */
public class AltaReferencia extends javax.swing.JPanel {
  EventoBoton eb;

  /** Creates new form plantilla */
  public AltaReferencia() {
    initComponents();
    eb = new EventoBoton();
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel2 = new javax.swing.JPanel();
        jSplitPane1 = new javax.swing.JSplitPane();
        jLabel1 = new javax.swing.JLabel();
        capacidadCampo = new javax.swing.JTextField();
        jSplitPane2 = new javax.swing.JSplitPane();
        jLabel2 = new javax.swing.JLabel();
        optimo = new javax.swing.JTextField();
        jSplitPane3 = new javax.swing.JSplitPane();
        jLabel3 = new javax.swing.JLabel();
        puntoCritico = new javax.swing.JTextField();
        jSplitPane4 = new javax.swing.JSplitPane();
        jLabel4 = new javax.swing.JLabel();
        puntoMarchites = new javax.swing.JTextField();
        jSplitPane5 = new javax.swing.JSplitPane();
        jLabel5 = new javax.swing.JLabel();
        saturacion = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jSplitPane6 = new javax.swing.JSplitPane();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        borrar = new javax.swing.JButton();
        registrar = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Registrar Referencia", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Maiandra GD", 1, 14))); // NOI18N

        panel2.setBackground(new java.awt.Color(255, 255, 255));
        panel2.setLayout(new java.awt.GridLayout(5, 0, 20, 10));

        jSplitPane1.setBackground(new java.awt.Color(255, 255, 255));
        jSplitPane1.setBorder(null);
        jSplitPane1.setDividerSize(0);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel1.setBackground(new java.awt.Color(255, 255, 255));
        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel1.setForeground(new java.awt.Color(0, 153, 102));
        jLabel1.setText("Capacidad Campo:");
        jSplitPane1.setLeftComponent(jLabel1);

        capacidadCampo.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jSplitPane1.setRightComponent(capacidadCampo);

        panel2.add(jSplitPane1);

        jSplitPane2.setBackground(new java.awt.Color(255, 255, 255));
        jSplitPane2.setBorder(null);
        jSplitPane2.setDividerSize(0);
        jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel2.setBackground(new java.awt.Color(255, 255, 255));
        jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel2.setForeground(new java.awt.Color(0, 153, 102));
        jLabel2.setText("Optimo:");
        jSplitPane2.setLeftComponent(jLabel2);

        optimo.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jSplitPane2.setRightComponent(optimo);

        panel2.add(jSplitPane2);

        jSplitPane3.setBackground(new java.awt.Color(255, 255, 255));
        jSplitPane3.setBorder(null);
        jSplitPane3.setDividerSize(0);
        jSplitPane3.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel3.setBackground(new java.awt.Color(255, 255, 255));
        jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel3.setForeground(new java.awt.Color(0, 153, 102));
        jLabel3.setText("Punto Critico:");
        jSplitPane3.setLeftComponent(jLabel3);

        puntoCritico.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jSplitPane3.setRightComponent(puntoCritico);

        panel2.add(jSplitPane3);

        jSplitPane4.setBackground(new java.awt.Color(255, 255, 255));
        jSplitPane4.setBorder(null);
        jSplitPane4.setDividerSize(0);
        jSplitPane4.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel4.setBackground(new java.awt.Color(255, 255, 255));
        jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel4.setForeground(new java.awt.Color(0, 153, 102));
        jLabel4.setText("Punto Marchites:");
        jSplitPane4.setLeftComponent(jLabel4);

        puntoMarchites.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jSplitPane4.setRightComponent(puntoMarchites);

        panel2.add(jSplitPane4);

        jSplitPane5.setBackground(new java.awt.Color(255, 255, 255));
        jSplitPane5.setBorder(null);
        jSplitPane5.setDividerSize(0);
        jSplitPane5.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel5.setBackground(new java.awt.Color(255, 255, 255));
        jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel5.setForeground(new java.awt.Color(0, 153, 102));
        jLabel5.setText("Saturación:");
        jSplitPane5.setLeftComponent(jLabel5);

        saturacion.setFont(new java.awt.Font("Times New Roman", 1, 12));
        jSplitPane5.setRightComponent(saturacion);

        panel2.add(jSplitPane5);
        panel2.add(jLabel6);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setLayout(new java.awt.GridBagLayout());

        jButton1.setFont(new java.awt.Font("Maiandra GD", 1, 12));
        jButton1.setText("jButton1");
        jSplitPane6.setLeftComponent(jButton1);

        jButton2.setFont(new java.awt.Font("Maiandra GD", 1, 12));
        jButton2.setText("jButton2");
        jSplitPane6.setLeftComponent(jButton2);

        borrar.setFont(new java.awt.Font("Maiandra GD", 1, 14)); // NOI18N
        borrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/img/borrar.png"))); // NOI18N
        borrar.setBorder(null);
        jSplitPane6.setRightComponent(borrar);

        registrar.setFont(new java.awt.Font("Maiandra GD", 1, 14)); // NOI18N
        registrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/img/registrar.png"))); // NOI18N
        registrar.setBorder(null);
        registrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                registrarActionPerformed(evt);
            }
        });
        jSplitPane6.setLeftComponent(registrar);

        jPanel1.add(jSplitPane6, new java.awt.GridBagConstraints());

        panel2.add(jPanel1);

        add(panel2);
    }// </editor-fold>//GEN-END:initComponents

  private void registrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrarActionPerformed
    // TODO add your handling code here:
    Referencia rs = new Referencia();
    rs.setCapacidadCampo(Float.parseFloat(capacidadCampo.getText()));
    rs.setOptimo(Float.parseFloat(optimo.getText()));
    rs.setPuntoCritico(Float.parseFloat(puntoCritico.getText()));
    rs.setPuntoMarchites(Float.parseFloat(puntoMarchites.getText()));
    rs.setSaturacion(Float.parseFloat(saturacion.getText()));
    eb.insertarFormulario(rs);
  }//GEN-LAST:event_registrarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton borrar;
    private javax.swing.JTextField capacidadCampo;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JSplitPane jSplitPane3;
    private javax.swing.JSplitPane jSplitPane4;
    private javax.swing.JSplitPane jSplitPane5;
    private javax.swing.JSplitPane jSplitPane6;
    private javax.swing.JTextField optimo;
    private javax.swing.JPanel panel2;
    private javax.swing.JTextField puntoCritico;
    private javax.swing.JTextField puntoMarchites;
    private javax.swing.JButton registrar;
    private javax.swing.JTextField saturacion;
    // End of variables declaration//GEN-END:variables
}
